	$(document).ready(function() {
		
		registerServicesForGadgets();
		loadHomeRightGadgets();
	});


function loadHomeRightGadgets() {
	
	gadgetSpecUrls = [
			'http://localhost:8080/scribbles/resources/gadgets/test1.xml',
			'http://localhost:8080/scribbles/resources/gadgets/test2.xml',
			'http://localhost:8080/scribbles/resources/gadgets/test3.xml' ];

	var len = gadgetSpecUrls.length;

	shindig.container.layoutManager = new shindig.FloatLeftLayoutManager(
			'homeRightBar');

	for ( var i = 0; i < len; i++) {
		shindig.container.addGadget(shindig.container.createGadget({
			specUrl : gadgetSpecUrls[i]
		}));

	}
	shindig.container.renderGadgets();
}

function registerServicesForGadgets() {
	gadgets.rpc.register('get_user_pid', getUserPID);
}

// ------------------------------- Gadget Services methods ----------------------
function getUserPID() {
	alert('GETTING USER PID FROM CONTAINER');
	return "32oiuwer38212a";
}